<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <SCRIPT src="/jquery-1.7.2.min.js" type="text/javascript">
    </SCRIPT>
    <SCRIPT src="/jquery.tmpl.js" type="text/javascript">
    </SCRIPT>
</head>
<body>
    <div id="fromhtml"> </div>
    <script id="miantmpl" type="text/x-jquery-tmpl">
        <template>

            <div>
                <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
                    {{each layoutitemlist}}
                        {{each widgetForm.list}}
                        {{tmpl($value) '#panelcodetmpl'}}
                        {{/each}}
                    {{/each}}

                    {{each layerlist}}
                    {{tmpl($value) '#dialogcodetmpl'}}
                    {{/each}}
                </el-form>
            </div>
        </template>
    </script>
    <script id="panelcodetmpl" type="type/x-jquery-tmpl">
        {{if type=="gridPanel"}}
            {{each columns}}
            <el-col :span="24" {{html options.tagattr}} v-if="readDataPermission.${model}!==false" >
                {{tmpl($value) '#fromcodetmpl'}}
            </el-col>
            {{/each}}

        {{else type=="tabs"}}
            <el-col :span="24">
                <el-tabs default-active-key="1" v-if="readDataPermission.${model}!==false">
                    {{each options.panelist}}
                    <el-tab-pane  key="${$index+1}" label="${title}" v-if="readDataPermission.${name}!==false"
                                  {{html options.tagattr}}>
                        <el-row >
                            {{each  columns}}
                                        {{tmpl($value) '#fromcodetmpl'}}
                            {{/each}}
                        </el-row>
                    </el-tab-pane>
                    {{/each}}
                </el-tabs>
            </el-col>
            {{else type=="collapse"}}
            <el-col :span="24">
                <a-collapse default-active-key="0" {{html options.tagattr}} v-if="readDataPermission.${model}!==false">
                    {{each options.panelist}}
                    <a-collapse-panel key="${$index}" header="${title}" v-if="readDataPermission.${name}!==false">
                        <el-row >
                            {{each  columns}}
                                        {{tmpl($value) '#fromcodetmpl'}}
                            {{/each}}
                        </el-row>
                    </a-collapse-panel>
                    {{/each}}
                </a-collapse>
            </el-col>
            {{else}}
            {{/if}}
    </script>
    <script id="dialogcodetmpl" type="type/x-jquery-tmpl">
        <zhlDialog title="${options.labelTitle}"
                   ref="${options.idPrefix}"
                   width="${options.width.indexOf("%")<0&&options.width.indexOf("px")<0?(options.width+"px"):options.width}"
                   height=""
                   class="my-dialog">

                    <div style="min-height:${options.height.indexOf("%")<0 &&options.height.indexOf("px")<0?(options.height+"px"):options.height}">
                                                                                                 {{each list}}
                                                                                                 {{tmpl($value) '#panelcodetmpl'}}
                                                                                                 {{/each}}
                      </div>
        		   {{if options.layertype == 'center'}}
        <el-row class="filterbottom">
        <div class="operation">
        {{each options.buttons}}
                    <el-button
                      type="${options.butType}"
                      style="margin-right:10px"
                      size="${options.butsize}"
                      icon="${options.icon}"
        ${getevent($value)} {{html options.tagattr}}
                      >${ options.labelTitle }</el-button
                    >
        {{/each}}
                </div>  </div>
        {{/if}}
        </zhlDialog>
    </script>
    <script id="wmpDetailcodetmpl" type="type/x-jquery-tmpl">
        {{if type == 'lable'}}
                <el-table-column prop="${dataIndex}"
                                 label="${title}" >
         <template slot-scope="scope">
        ${"{{scope.row."+dataIndex}}}
        </template>
         </el-table-column>
        {{else}}
                <el-table-column prop="${dataIndex}"
                                 label="${title}" class-name="${ options.required == true?" required":"" }">
                    <template slot-scope="scope">
                        <div class="el-input el-input--small">
                            {{if  type=="input"}}
                            <el-input placeholder="请输入${ title }内容" ${options.disabled?"disabled":""} v-model="scope.row.${dataIndex}" maxlength="${options.dataLength}" ${getevent($data)} {{html options.tagattr}}></el-input>
                           {{else type == 'textarea'}}
                            <el-input type="textarea"
                                      rows="2"
                                      placeholder="请输入${ title }内容" ${options.disabled?"disabled":""} v-model="scope.row.${dataIndex}" maxlength="${options.dataLength}" ${getevent($data)} {{html options.tagattr}}>
                            </el-input>
                            {{else type == 'select'}}
                        <el-select placeholder="请选择${ title}" ${options.disabled?"disabled":""} v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}}>
                            {{if options.isRemote==true}}
                              <el-option  v-for="(item,index) in controlData.${dataIndex}" :key="index"
                                           :label="item.${options.labelText}"
                                          :value="item.${options.labelValue}">
                                </el-option>
                            {{else}}
                                              {{each options.options}}
                                                <el-option label="${label}"
                                                           value="${value}">
                                                </el-option>
                                                {{/each}}
                            {{/if}}
                        </el-select>
                            {{else type == 'date'}}
                            {{if options.modeltype == 'date'}}
                             <el-date-picker placeholder="${options.placeholder}"
                                                format="${options.format}"
                                                value-format="${options.format}"
                                                type="${options.modeltype}"
                                                ${options.disabled?"disabled":""} v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />
                                {{else options.modeltype == 'range'}}
                                <el-date-picker
                                  v-model="scope.row.${dataIndex}"
                                  type="monthrange"
                                  format="${options.format}"
                                  value-format="${options.format}"
                                  range-separator="至"
                                  start-placeholder="${options.placeholder}"
                                  end-placeholder="${options.placeholder}" ${getevent($data)} {{html options.tagattr}} ${options.disabled?"disabled":""}>
                                </el-date-picker>
                                {{/if}}
                            {{else type == 'radio'}}
                            <el-radio-group size="mini"
                                            style="line-height:43px; display:block;" ${options.disabled?"disabled":""} v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}}>
                               {{if options.isRemote==true}}
           <el-radio  v-for="(item,index) in controlData.${options.filed}" :key="index"
                       :label="item.${options.labelText}"
                      :value="item.${options.labelValue}">
            </el-radio>
        {{else}}
                              {{each options.options}}
                                <el-radio style="inline"
                                          label="${value}">${ label }</el-radio>
                                {{/each}}
        {{/if}}
                            </el-radio-group>
                            {{else type == 'checkbox'}}
                            <el-checkbox-group size="mini"
                                               style="line-height:43px;" ${options.disabled?"disabled":""} v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}}>
                               {{if options.isRemote==true}}
           <el-checkbox  v-for="(item,index) in controlData.${dataIndex}" :key="index"
                       :label="item.${options.labelText}"
                      :value="item.${options.labelValue}">
            </el-checkbox>
                             {{else}}
                              {{each options.options}}
                                <el-checkbox style="inline"
                                             label="${value}" disabled>${label}</el-checkbox>
                                {{/each}}
                            {{/if}}
                            </el-checkbox-group>
                            {{else type == 'editor'}}

                            {{else type == 'blank'}}

                            {{else type == 'rate'}}
                            <el-rate ${options.readonly?"readonly='true' ":" "} v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}}></el-rate>
                            {{else type == 'inputnumber'}}
                            <el-input-number ${options.disabled?"disabled":""}
                                             min="${options.min}"
                                             max="${options.max}"
                                             label="${options.describe}"
                                             step="${options.step}"
                                             precision="${options.precision}" v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}}></el-input-number>
                            {{else type == 'timepicker'}}
                            <a-time-picker use12-hours
                                           format="${options.timeformat}"
                                           ${options.disabled?"disabled":""}
                                           minute-step="${options.minute}"
                                           second-step="${options.second}" v-model="scope.row.${dataIndex}" ${getevent($data)} {{html options.tagattr}} />

                            {{else type == 'user'}}
                            <a-input-search placeholder="input search text"   {{html options.tagattr}} />
                            {{else type == 'department'}}
                            <input type="text" placeholder="" class="form-control" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else type == 'project'}}
                            <input type="text" placeholder="" class="form-control" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else type == 'cost'}}
                            <input type="text" placeholder="" class="form-control" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else type == 'choose'}}
                            <input type="text" placeholder="" class="form-control" {{html options.tagattr}}><i aria-hidden="true" class="fa fa-search" style="position: absolute; right: 25px; top: 15px;"></i>
                            {{else  type == 'button' }}
                            {{each options.buttons}}
                        <el-button style="margin-left:5px;"   ${getevent($value)} {{html options.tagattr}}   type="${options.butType}"
                      size="${options.butsize}"
                      icon="${options.icon}" :plain="${options.isplain}"
          :round="${options.isround}"
          :circle="${options.iscircle}"
          :disabled="${options.disabled}">
                            ${options.labelTitle}
                        </el-button>
                            {{/each}}
                            {{/if}}
                        </div>
                    </template>
                </el-table-column>
        {{/if}}
    </script>
    <script id="fromcodetmpl" type="type/x-jquery-tmpl">
        {{each list}}
        {{if type == 'listview'}}
        <a-col :span="24" v-if="readDataPermission.${model}!==false">
          <div class="ant-table_container">
           <el-table   :data="formData.${options.controlId}"     ref="${options.controlId}"    style="width: 100%">
              {{each options.columns}}
           {{tmpl($value) '#wmpDetailcodetmpl'}}
             {{/each}}
           </el-table>
        </div>
        {{if options.isPage == true}}
          <div class="ant-table_footer" >
              <a-pagination
                :loading="controlData.${options.controlId}.pagination.isloading"
                v-model="controlData.${options.controlId}.pagination.currnet"
                :default-current="1"
                :total="controlData.${options.controlId}.pagination.total"
                show-quick-jumper
                @change="${options.controlId}handleTableChange"
                @showSizeChange="${options.controlId}showSizeChange"
                :pageSize="controlData.${options.controlId}.pagination.pagesize"
                show-size-changer
              />
           </div>
          ${addhandleTableChange(options.controlId,options.sourceApiId)}
        {{/if}}
    </a-col>
        ${setfromData($value)}
        {{else rowcontrolstr.indexOf(type + ',') >= 0}}
        <el-col :xs="${options.xs}"
    :md="${options.md}"
    :lg="${options.lg}" v-if="readDataPermission.${model}!==false">
            <el-col
                    style="${getrowcontrolcss($value)}">
                {{if type == 'tree'}}
                <el-tree></el-tree>
                {{else type == 'partlayout' }}
                <el-col :xs="${options.xs}"
    :md="${options.md}"
    :lg="${options.lg}"
            style="padding:0px">
                    {{tmpl($value) '#fromcodetmpl'}}
                </el-col>
                {{else type == 'imgage' }}
                <img data-v-6c4399d0=""
                     src="http://localhost:8080/file/downloadImg?path=AttachmentFile%5C2021-01-11-12-30%5Ca54eb02e-faca-46a4-8262-e8ea6cefa217.jpg"
                     width="150px"
                     height="80px" />
                {{else type == 'upFilesComp' }}
                    {{if options.uptype =='file'}}
                           <upFilesComp :fileListArr="formData.${options.filed}"></upFilesComp>
                    {{else options.uptype =='img'}}
                      <upManyImgComp  :fileListArr="formData.${options.filed}" :limit="1"></upManyImgComp>
                      {{else options.uptype =='arryimg'}}
                      <upManyImgComp :fileListArr="formData.${options.filed}"
                      ></upManyImgComp>
                   {{/if}}
                 ${setfromData($value)}
                {{/if}}
            </el-col>
        </el-col>
        {{else type == 'button'}}
        <el-col :xs="${options.xs}"
    :md="${options.md}"
    :lg="${options.lg}"  v-if="readDataPermission.${model}!==false">
            {{each options.buttons}}
            <el-button style="margin-left:5px;    margin-top: 5px;" size="mini"  ${getevent($value)} {{html options.tagattr}} type="${options.butType}"
                      size="${options.butsize}"
                      icon="${options.icon}"  :plain="${options.isplain}"
          :round="${options.isround}"
          :circle="${options.iscircle}"
          :disabled="${options.disabled}">
                  ${options.labelTitle}
            </el-button>
            {{/each}}
        </el-col>
        {{else}}
    <el-col :xs="${options.xs}"
    :md="${options.md}"
    :lg="${options.lg}"
            style="padding:0px"  v-if="readDataPermission.${model}!==false">
        ${setfromData($value)}

            <el-form-item label="${title}" prop="${options.filed}" label-width="${title==''?'0':options.labelwidth}px">

            {{if type == 'input'}}
            <el-input placeholder="请输入${ title}内容"   :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"  v-model="formData.${options.filed}" maxlength="${options.dataLength}" ${getevent($value)} {{html options.tagattr}}></el-input>
            {{else type == 'textarea'}}
            <el-input type="textarea"
                      rows="${options.rows}"
                      placeholder="请输入${ title }内容" :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"   v-model="formData.${options.filed}" maxlength="${options.dataLength}" ${getevent($value)} {{html options.tagattr}}>
            </el-input>
            {{else type == 'editor'}}
            <Editor ref="${options.filed}"
                    :value.sync="formData.${options.filed}"></Editor>
            {{else type == 'select'}}
        <el-select placeholder="请选择${title}" :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"   v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}  style="width: 100%;">
        {{if options.isRemote==true}}
          <el-option  v-for="(item,index) in controlData.${options.filed}" :key="index"
                       :label="item.${options.labelText}"
                      :value="item.${options.labelValue}">
            </el-option>
        {{else}}
           {{each options.options}}
            <el-option
                       label="${label}"
                      value="${value}">
            </el-option>
            {{/each}}
        {{/if}}
        </el-select>
            {{else type == 'date'}}
            {{if options.modeltype == 'date'}}
         <el-date-picker placeholder="${options.placeholder}"
                            format="${options.format}"
                            value-format="${options.format}"
                            type="${options.modeltype}"
                            :disabled="${options.disabled}||!(writeDataPermission.${model}===true)" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />
            {{else options.modeltype == 'range'}}
            <el-date-picker
              v-model="formData.${options.filed}"
              type="monthrange"
              format="${options.format}"
              value-format="${options.format}"
              range-separator="至"
              start-placeholder="${options.placeholder}"
              end-placeholder="${options.placeholder}" ${getevent($value)} {{html options.tagattr}} :disabled="${options.disabled}||!(writeDataPermission.${model}===true)">
            </el-date-picker>
            {{/if}}
            {{else type == 'radio'}}
            <el-radio-group size="mini"
                            style="line-height:43px; display:block;" :disabled="${options.disabled}||!(writeDataPermission.${model}===true)" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}>
                {{if options.isRemote==true}}
                     <el-radio  v-for="(item,index) in controlData.${options.filed}" :key="index"
                               :label="item.${options.labelText}"
                              :value="item.${options.labelValue}">
                    </el-radio>
                {{else}}
                    {{each options.options}}
                        <el-radio style="inline"
                                  label="${value}">${ label }</el-radio>
                        {{/each}}
                {{/if}}
            </el-radio-group>
            {{else type == 'checkbox'}}
            <el-checkbox-group size="mini"
                               style="line-height:43px;" :disabled="${options.disabled}||!(writeDataPermission.${model}===true)" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}>
         {{if options.isRemote==true}}
               <el-checkbox  v-for="(item,index) in controlData.${options.filed}" :key="index"
                       :label="item.${options.labelText}"
                      :value="item.${options.labelValue}">
            </el-checkbox>
         {{else}}
            {{each options.options}}
                <el-checkbox style="inline"
                             label="${value}" >${label}</el-checkbox>
                {{/each}}
        {{/if}}
            </el-checkbox-group>
            {{else type == 'editor'}}
         {{else type == 'switch'}}
              <el-switch
                v-model="formData.${options.filed}"
                active-color="${options.activecolor}"
                inactive-color="${options.inactivecolor}"
                :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"
              >
              </el-switch>
            {{else type == 'colorpicker'}}
           <el-color-picker
            v-model="formData.${options.filed}"
            :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"
            size="${options.butsize}"
          >
          </el-color-picker>
             {{else type == 'slider'}}
          <el-slider
            v-model="formData.${options.filed}"
           ${options.range?"range":""}
            :max="${options.max}"
            :min="${options.min}"
            :step="${options.step}"
            :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"
          >
          </el-slider>
            {{else type == 'rate'}}
            <el-rate ${options.readonly?"readonly='true' ":" "}  :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"   v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}></el-rate>
            {{else type == 'inputnumber'}}
            <el-input-number  :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"
                             min="${options.min}"
                             max="${options.max}"
                             label="${options.describe}"
                             step="${options.step}"
                             precision="${options.precision}" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}}></el-input-number>
            {{else type == 'timepicker'}}
            <a-time-picker use12-hours
                           format="${options.timeformat}"
                           :disabled="${options.disabled}||!(writeDataPermission.${model}===true)"
                           minute-step="${options.minute}"
                           second-step="${options.second}" v-model="formData.${options.filed}" ${getevent($value)} {{html options.tagattr}} />

            {{else type == 'user'}}
            <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix" @click="$refs.${options.filed}dialog.visible = true"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
            <zhlDialog title="${options.precision}"
                       ref="${options.filed}dialog"
                       width="960px"
                       class="my-dialog">
                <selector :typemode="1"
                          @confirm="selector${options.filed}confirm"
                          @close="$refs.${options.filed}dialog.visible = false"></selector>
            </zhlDialog>
            ${addselectorconfirm(options.filed)}
            {{else type == 'department'}}
            <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix" @click="$refs.${options.filed}dialog.visible = true"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
            <zhlDialog title="${options.precision}"
                       ref="${options.filed}dialog"
                       width="960px"
                       class="my-dialog">
                <selector :typemode="2"
                          @confirm="selector${options.filed}confirm"
                          @close="$refs.${options.filed}dialog.visible = false"></selector>
            </zhlDialog>
            ${addselectorconfirm(options.filed)}
            {{else type == 'project'}}
            <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
            {{else type == 'cost'}}
            <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
            {{else type == 'choose'}}
            <span class="ant-input-search ant-input-affix-wrapper" data-v-a1ccd506="" {{html options.tagattr}}><input placeholder="${options.precision}" v-model="formData.${options.filed}.text" type="text" readonly="readonly" class="ant-input"><span class="ant-input-suffix"><i aria-label="图标: search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></span>
            {{/if}}

            </el-form-item>

    </el-col>
        {{/if}}
        {{/each}}
    </script>
    <script id="buildactioncode" type="type/x-jquery-tmpl">
        ${key}(page){
         {{if controlType=='listview'}}
            this.controlData.${controlId}.pagination.isloading=true;
         {{/if}}
        const param=  {
        {{each paramlist}}
        {{if children.length>0}}
         ${setbuildactionitem($value)}
        ${property}:{{tmpl($value) '#buildactionItemcode'}}
        {{/if}}
        {{if $index<(children.length-1)}} ,
        {{/if}}
        {{/each}}
        };
        {{if type=='swagger'}}
          this.$ajaxswagger("${sourceApi}",param).then(res=>{
if(res.code!=0){
this.$message.error(res.msg);
}
          {{if controlType=='listview'}}
this.formData.${controlId}=res.${swaggerconfig.list};
         this.controlData.${controlId}.pagination.isloading=false;
        this.controlData.${controlId}.pagination.total=res.${swaggerconfig.totalcount};
          {{else}}
        this.controlData.${controlId}=res.${swaggerconfig.list};
    {{/if}}

                 });
           {{else}}
         {{if controlType=='listview'&& isPage==true}}
         param.body.page=page;
         param.body.rows=this.controlData.${controlId}.pagination.pagesize;
        {{/if}}
         this.$apiComm("${sourceApi}",param).then(res=>{
if(res.code!=0){
this.$message.error(res.msg);
}
         {{if controlType=='listview'}}
        this.formData.${controlId}=res.data.list;
        this.controlData.${controlId}.pagination.isloading=false;
        this.controlData.${controlId}.pagination.total=res.totalcount;
        {{else}}
        this.controlData.${controlId}=res.data.list;
    {{/if}}
                 });
        {{/if}}
        }
    </script>
    <script id="buildactionItemcode" type="type/x-jquery-tmpl">
        {
        {{each children}}
        {{if variabletype=='Object' && children.length>0}}
         ${setbuildactionitem($value)}
        ${property}:{{tmpl($value) '#buildactionItemcode'}}
          {{if $index<(buildactionitem.children.length-1)}} ,
        {{/if}}
        {{else  paramvalue!=''}}
           {{if  paramvalue.indexOf('◇')>=0}}
            ${property}:"${paramvalue.substring(1,paramvalue.length)}"
           {{else    paramvalue.indexOf('◆')>=0}}
            ${property}:${paramvalue.substring(1,paramvalue.length)}
           {{else}}
           ${property}:this.formData.${paramvalue}
           {{/if}}
          {{if $index<(buildactionitem.children.length-1)}} ,
          {{/if}}
        {{/if}}

        {{/each}}
        }
    </script>
    <script id="buildAjaxcode" type="type/x-jquery-tmpl">
        const param=  {
        {{each paramlist}}
        {{if children.length>0}}
         ${setbuildactionitem($value)}
        ${property}:{{tmpl($value) '#buildactionItemcode'}}
        {{/if}}
        {{if $index<(children.length-1)}} ,
        {{/if}}
        {{/each}}
        };
        {{if type=='swagger'}}
          this.$ajaxswagger("${sourceApi}",param).then(res=>{
            if(res.code!=0){
            this.$message.error(res.msg);
            }

                 });
           {{else}}
         this.$apiComm("${sourceApi}",param).then(res=>{
if(res.code!=0){
this.$message.error(res.msg);
}
                 });
        {{/if}}
    </script>
    <div id="buildcode"></div>
    <script type="text/javascript">
        var swaggerconfig = {};
        var formData = {};
        var controlData = {};
        var eventdatafunction = {};
        var jsobject = {};
        var rules = {};
        var modelfiled={};
        var rowcontrolstr = 'tree,navmenu,blank,partlayout,dynamiclayout,calendar,imgage,upFilesComp,upImgComp,upManyImgComp'; ///占整行的控件
        var dynamicheight = 'partlayout,tree,calendar,imgage,upFilesComp,'; ///由内部控件撑高度的控件
        var minheight = 'partlayout,dynamiclayout,'
        var buildactionitem = {};
        var actionfunstr = "";
        function setbuildactionitem(item) {
            buildactionitem = item;
            return "";
        }
        ///大小写问题 需要替换
        var casestring = {
            zhldialog: 'zhlDialog',
            upfilescomp: 'upFilesComp',
            upimgcomp: 'upImgComp',
            upmanyimgcomp: 'upManyImgComp',
            editor: 'Editor',
            showsizechange: 'showSizeChange'
        }
        function getStorageValue(key) {
            var strStorage = localStorage.getItem(key);
            if (strStorage == null) {
                strStorage = sessionStorage.getItem(key)
            }
            if (strStorage != null) {
                var obj = JSON.parse(strStorage);
                var content = {};
                if (obj.dataType === 'string') {
                    content = obj.content
                } else if (obj.dataType === 'number') {
                    content = Number(obj.content)
                } else if (obj.dataType === 'boolean') {
                    /* eslint-disable */
                    content = eval(obj.content)
                } else if (obj.dataType === 'object') {
                    content = obj.content
                }
                return content;
            }
        }
        function buildpubish(frominfo, jscode) {
            rules = {};
            modelfiled={};
            swaggerconfig = getStorageValue("swaggerconfig");
            actionfunstr = "";
            var isError = loadjscode(jscode);
            if (isError == false) {
                return false;
            }
            var htmlcode = $("#miantmpl").tmpl(frominfo).prop("outerHTML");
            for (var key in casestring) {
                var reg = new RegExp(key, "g");
                htmlcode = htmlcode.replace(reg, casestring[key]);
            }
            //  htmlcode = style_html(htmlcode, tabsize, tabchar, 80);
            var jscode = bulidjscode(frominfo);
            isError = loadjscode(jscode);
            if (isError == false) {
                return false;
            }
            //   jscode = jsbeautify(jscode);
            var buildObject = {
                htmlcode: htmlcode,
                jscode: "export default " + jscode,
                csscode: getcss()
            };
            return buildObject;
        }
        function loadjscode(jscode) {
            eventdatafunction = {};
            formData = {};
            controlData = {};
            jsobject = {
                data() {
                    return {}
                }, methods: {}
            }
            if (jscode != undefined && jscode != "") {
                try {
                    jsobject = eval("(" + jscode.replace('export default', '') + ")");
                } catch {
                    return false
                }
                if (jsobject.methods != undefined) {
                    eventdatafunction = Object.assign(jsobject.methods)
                }
            }
            return true
        }

        function bulidjscode() {
            var jscode = "";
            var newjsdata = Object.assign(jsobject.data());
            newjsdata["formData"] = formData;
            newjsdata["rules"] = rules;
            newjsdata["modelfiled"] = modelfiled;
            newjsdata["readDataPermission"] = {};
            newjsdata["writeDataPermission"] = {};
            newjsdata["controlData"] = controlData;
            jsobject["props"]=["DataPermission"]
            var methodseventfunction = "";

            /////生成Actionfun 方法
            //for (var key in frominfo.actionfun) {
            //    var item = frominfo.actionfun[key];
            //    item.key = key;
            //    $("#buildcode").html('');
            //    $("#buildactioncode").tmpl(item).appendTo("#buildcode");
            //    eventdatafunction[key] = $("#buildcode").html().replace(/&gt;/g, ">");
            //    actionfunstr = actionfunstr + `${key}(1);`
            //}
            eventdatafunction["funmounted"] = `\n//系统方法页面加载方法 \nfunmounted(){${actionfunstr}
   }`
            for (var key in eventdatafunction) {
                methodseventfunction = methodseventfunction == "" ? eventdatafunction[key].toString() : methodseventfunction + "," + eventdatafunction[key].toString();
            }
            jscode = jscode + "{";
            for (key in jsobject) {
                var codestr = jscode == "{" ? "" : ",";
                if (key == "data" && typeof (jsobject[key]) == "function") {
                    jscode = jscode + codestr + " data(){ return " + JSON.stringify(newjsdata) + "} ";
                } else if (typeof (jsobject[key]) == "function") {
                    jscode = jscode + codestr + jsobject[key].toString();
                } else if (key == "methods" && typeof (jsobject[key]) == "object") {
                    jscode = jscode + codestr + " methods:{" + methodseventfunction + "} ";
                } else if (typeof (jsobject[key]) == "object") {
                    if (jsobject[key] instanceof Array) {
                        jscode = jscode + codestr + " " + key + ":" + buildArray(jsobject[key]) + " ";
                    } else {
                        jscode = jscode + codestr + " " + key + ":" + bulidobject(jsobject[key]) + " ";
                    }
                } else if (typeof (jsobject[key]) != "undefined") {
                    jscode = jscode + codestr + " " + key + ":'" + jsobject[key].toString().replace(/\"/g, "\\\"") + "'";
                }
            }
            if (jsobject["mounted"] == undefined || jsobject["mounted"] == null) {
                jscode = jscode + `,mounted(){this.funmounted();}`;
            }
            jscode = jscode + "}";
            return jscode;
        }
        function bulidobject(obj) {
            var jscode = "{";
            for (key in obj) {
                var codestr = jscode == "{" ? "" : ",";
                if (key == "formData") {
                    jscode = jscode + codestr + " " + key + ":'" + JSON.stringify(obj[key]) + "'";
                } else if (typeof (obj[key]) == "function") {
                    jscode = jscode + codestr + obj[key].toString();
                } else if (typeof (obj[key]) == "object") {
                    if (obj[key] instanceof Array) {
                        jscode = jscode + codestr + key + ":" + buildArray(obj[key]) + "";
                    } else {
                        jscode = jscode + codestr + key + ":" + bulidobject(obj[key]) + "";
                    }
                } else if (typeof (obj[key]) != "undefined") {
                    jscode = jscode + codestr + key + ":'" + obj[key].toString().replace(/\"/g, "\\\"") + "'";
                }
            }
            jscode = jscode + "}";
            return jscode
        }
        function buildArray(arry){
            var jscode = "[";
            for (let idex=0;idex<arry.length;idex++) {
                var codestr = jscode == "[" ? "" : ",";
                if (typeof ( arry[idex]) == "object") {
                    if (arry[idex] instanceof Array) {
                        jscode = jscode + codestr +  buildArray(arry[idex]) ;
                    } else {
                        jscode = jscode+codestr+   bulidobject(arry[idex]);
                    }
                }else{
                    jscode = jscode+codestr+"\""+arry[idex]+"\""
                }
            }
            jscode = jscode + "]";
            return jscode
        }
        function getrowcontrolcss(element) {
            var cssstr = "padding:0px";
            cssstr = cssstr + (minheight.indexOf(element.type + ',') == 0 ? 'min-height:42px' : '');
            cssstr = cssstr + dynamicheight.indexOf(element.type + ',') >= 0 ? 'height:auto' : (element.options.rowSpan !== undefined ? "height" + element.options.rowSpan * 42 + 'px' : 'height:auto');
            return cssstr;
        }

        function getevent($obj) {
            var eventcode = "";
            if ($obj.eventlist == undefined) {
                return eventcode;
            }
            for (var i = 0; i < $obj.eventlist.length; i++) {
                if ($obj.eventlist[i].value != "" && $obj.eventlist[i].value != undefined) {
                    eventcode = eventcode + " @" + $obj.eventlist[i].label + '=' + $obj.eventlist[i].value + '';
                    if ($obj.eventlist[i].value.indexOf("(") < 0) {
                        if (eventdatafunction[$obj.eventlist[i].value] == undefined) {
                            eventdatafunction[$obj.eventlist[i].value] ="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+ $obj.eventlist[i].value + "() { }";
                        }else{
                            eventdatafunction[funname]="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+eventdatafunction[funname]
                        }
                    } else {
                        var funname = $obj.eventlist[i].value;
                        funname = funname.substring(0, $obj.eventlist[i].value.indexOf("("));
                        if (eventdatafunction[funname] == undefined) {
                            var funparamstr = $obj.eventlist[i].value.replace(funname + "(", "").replace(")", "").split(",");
                            var funname = funname + "(";
                            if (funparamstr[0] != "") {
                                for (var i = 0; i < funparamstr.length; i++) {
                                    if (i == 0) {
                                        funname = funname + "param" + i;
                                    } else {
                                        funname = funname + ",param" + i;
                                    }
                                }
                            }
                            funname = funname + ")"
                            eventdatafunction[funname] ="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+ funname + "{ }";
                        }else{
                            eventdatafunction[funname]="\n // "+$obj.title+$obj.eventlist[i].label+"事件方法 \n"+eventdatafunction[funname]
                        }
                    }
                }
            }
            return eventcode;
        }
        ///选人选部门 点击确定事件
        function addselectorconfirm(filed) {
            var funname = `selector${filed}confirm`;
            if (eventdatafunction[funname] == undefined) {
                eventdatafunction[funname] = funname + `(selectlist) { \r\n this.formData.${filed}.text="";\n\r this.formData.${filed}.value=[]; \n\r for (let i = 0; i < selectlist.length; i++) {
                                     this.formData.${filed}.text=this.formData.${filed}.text==""?selectlist[i].Name:this.formData.${filed}.text+";"+selectlist[i].Name;\n\r  this.formData.${filed}.value.push(selectlist[i]);\n\r
                                    }\n\r
                            this.$refs.${filed}dialog.visible = false;\n\r
                            }\n\r`;
            }
            return "";
        }
        function addhandleTableChange(controlId, sourceApiId) {
            var handlefunname = `${controlId}handleTableChange`;
            var showSizefunname = `${controlId}showSizeChange`;
            if (eventdatafunction[handlefunname] == undefined) {
                eventdatafunction[handlefunname] = `${controlId}handleTableChange(pagination) {
                                                    this.${sourceApiId}(pagination)
                                                }`
            }
            if (eventdatafunction[showSizefunname] == undefined) {
                eventdatafunction[showSizefunname] = `${controlId}showSizeChange(page, pageSize) {
this.controlData.${controlId}.pagination.pagesize=pageSize;
                                                    this.${sourceApiId}(1)
                                                }`
            }
            return "";
        }

        ///生成fromdata 结构
        function setfromData($this) {
            let type=$this.type;
            let options=$this.options;
            let title=$this.title;
            if (type == "listview") {
                if (options.controlId != undefined) {
                    if (formData[options.controlId] == undefined) {
                        formData[options.controlId] = []
                        formData["del" + options.controlId] = []
                        //if (options.sourceApi != undefined && options.sourceApi != '' && options.sourceApi.indexOf('/') < 0) {
                        controlData[options.controlId] = {};
                        controlData[options.controlId]["queryparam"] = {}
                        controlData[options.controlId]["scopedSlots"] = []
                        controlData[options.controlId]["pagination"] = { currnet: 1, total: 0, pagesize: 10, isloading: false }
                        for (var i = 0; i < options.columns.length; i++) {
                            var columnitem = options.columns[i];
                            if (columnitem.isScopedSlots) {
                                controlData[options.controlId].scopedSlots.push(columnitem.dataIndex);
                            }
                            if (columnitem.options != null && columnitem.options.filed != "" && columnitem.options.filed != undefined) {
                                modelfiled[columnitem.model] =columnitem.options.filed
                                rules[columnitem.options.filed] = []
                                if (columnitem.options.ruleslist != undefined) {
                                    rules[columnitem.options.filed] = JSON.parse(JSON.stringify(columnitem.options.ruleslist));
                                }
                                if (columnitem.options.required == true) {
                                    rules[columnitem.options.filed].push({
                                        required: true,
                                        message: columnitem.title + '必填',
                                        trigger: 'blur'
                                    });
                                }

                            }

                        }
                    }
                }
            }
            else if ('upFilesComp' == type) {
                if (options.filed != undefined) {
                    if (formData[options.filed] == undefined) {
                        formData[options.filed] = []
                    }
                }
            } else if ("user,department,project,cost,choose".indexOf(type) >= 0) {
                if (options.filed != undefined) {
                    if (formData[options.filed] == undefined) {
                        formData[options.filed] = { text: "", value: [] }
                    }
                }
            } else {
                if (options.filed != undefined) {
                    if (options.defaultValue != undefined) {
                        formData[options.filed] = options.defaultValue;
                    } else {
                        formData[options.filed] = "";
                    }
                }
            }
            if (options.sourceApiId != undefined && options.source.type != undefined && options.source.type != undefined) {
                options.source.controlType = type;
                options.source.key = options.sourceApiId;
                options.source.controlId = options.filed == undefined ? options.controlId : options.filed;
                options.source.isPage = options.isPage;
                $("#buildcode").html('');
                $("#buildactioncode").tmpl(options.source).appendTo("#buildcode");
                eventdatafunction[options.sourceApiId] = $("#buildcode").html().replace(/{controlId}/g, options.source.controlId).replace(/&gt;/g, ">");
                actionfunstr = actionfunstr + `this.${options.sourceApiId}(1);`
                if (type != 'listview') {
                    controlData[options.source.controlId] = [];
                }
            }
            if (options.filed != undefined) {
                modelfiled[$this.model] =options.filed
                rules[options.filed] = []
                if (options.ruleslist != undefined) {
                    rules[options.filed] = JSON.parse(JSON.stringify(options.ruleslist));
                }
                if (options.required) {
                    rules[options.filed].push({
                        required: true,
                        message: title + '必填',
                        trigger: 'blur'
                    });
                }
            }
            return "";
        }

        function buildsource(source) {
            $("#buildcode").html('');
            $("#buildAjaxcode").tmpl(source).appendTo("#buildcode");
            return $("#buildcode").html().replace(/&gt;/g, ">");
        }
        function getcss() {
            return $("#commoncss").html();
        }
    </script>
    <style id="commoncss">
    </style>
</body>

</html>
